SetWorkingDirBox("Set a working directory for your project",
"This acesses and updates the Registry. See the source code for the exact method. You can browse for a new directory using the Browse button, or type in the new control.",
RegistryKey, Selection$, Res)
RDBCloseKey(RegistryKey,Res)
Goto Wait_for_Input
MonthlyCalendar:
DrawBackground
Waiting = 1
MonthCalControl(20,30, "Display this month and next month", 2,
"PiXCL includes a number of built-in dialog box styles, user defined dialogs, plus the Windows common dialogs. This program demonstrates how these dialogs can be used.
Start with the built-in dialogs menu items, then run some custom dialogs, look at the set of available common dialogs.",
LEFT)
Goto Wait_for_Input
DemoTextBox:
Text$ = "Standard text box text field. You can set default text, edit and copy to or from the clipboard."
Label$ = "Enter some data from the keyboard"
Input$ = "blah blah blah"
TextBox(Text$,Label$,Input$,Btn)
If Btn = 1
MessageBox(OK,1,INFORMATION,Input$,
"This is the result of the entry",Res)
Else
MessageBox(OK,1,EXCLAMATION,
"Your program would branch accordingly, usually to wait for more input.",
"Cancel button was pressed",Res)
Endif
Goto Wait_for_Input
DemoTextBoxEx:
Text$ = "Extended text box text field. Use this dialog when you need more information, and want to be able to add some help if your user requests it."
Label$ = "Enter some data from the keyboard"
Input$ = "blah blah blag"
Help$ =
"This is where context sensitive help is added. It appears automatically
ImageBox("User defined ImageBox Title",Image$, Text$,
"&Button#1", "&More Info",Btn)
FreeBitMap(Image$)
If Btn = 1
MessageBox(OK,1,INFORMATION, "First button was pressed.","Button#1", Res)
Else
MessageBox(OK,1,INFORMATION, "Second button was pressed.","More Info", Res)
Endif
Goto Wait_for_Input
DemoCustomDlgs:
DrawBackground
MessageBox(OKCANCEL,1,INFORMATION,
"Compare this MessageBox with the one following.
Standard MessageBox command style is screen centered.",
"Standard MessageBox style",Res)
Msg1$ =
"This is a block of text that appears in a static region in a custom dialog box created by the DialogBox command. This text wraps around and can also be centered in the region if desired. The optional icon size and position can be specified in the command."
Msg2$ =
"Custom Dialogs can be positioned relative to the PiXCL application client area, or centered in your screen work area."
DialogBox(10,20,260,120,"Custom Message Box using DialogBox command", CAP_NCTR,
400,110, 64,64, WINLOGO,
190,30,240,45,"&More Info", 5, Res,
190,10,240,25,BTN,PUSH,"Stop This &Now",
25,2,185,48,STATIC, LEFT, Msg1$,
25,49,185,54,BTN,GROUP,"",
10,2,11,84,BTN,GROUP,"",
25,58,185,90,STATIC, LEFT, Msg2$)
If Res = 1 Then Goto Wait_for_Input
Msg$ = "Please enter your UserID and Password"
Info$ = "Information"
MoreInfo$ = "User IDs and Passwords are automatically checked by the Server. Once verified you will be logged into your secure user account."
DialogBox(20,20,250,110,"Custom Password Box using DialogBox command", CAP_NCTR,
350,110, 64,64, WINLOGO,
170,35,220,50,"&OK", 6, Res,
170,15,220,30,BTN,PUSH,"&Cancel",
25,2,165,18,STATIC, LEFT, Msg$ ,
4,17,160,30,EDIT,STRING,"",UserID$,
4,37,160,50,EDIT,PASSWORD,"",Pwd$,
4,52,160,88,BTN,GROUP,Info$,
6,60,158,87,STATIC,LEFT,MoreInfo$)
If Res = 1 Then Goto Wait_for_Input
DrawBackground
If UserID$ = "" Then MessageBox(OK,1,EXCLAMATION,"Invalid User ID","Cannot continue",Res) Goto Wait_for_Input
If Pwd$ <> ""
DrawText(10,30,UserID$)
DrawText(10,50,Pwd$)
Endif
If Pwd$ = "" Then MessageBox(OK,1,EXCLAMATION,"Invalid Password","Cannot continue",Res) Goto Wait_for_Input
State1 = 1 State2 = 1
State3 = 0 State4 = 1
DialogBox(0,0,220,180,"Custom Dialog Box controls for PiXCL 4.4", CAP_NCTR,
15,25, 48,48, ICON01,
150,42,190,54,"&Cancel", 13, Res,
150,10,190,22,BTN, PUSH,"&OK",
100,26,140,38,BTN, AUTORADIO,"Help1",State1,
150,26,190,38,BTN, AUTORADIO,"Help2",State2,
100,58,140,70,BTN, AUTOCHECK,"Check1",State3,
150,58,190,70,BTN, AUTOCHECK,"Check2",State4,
90,2,200,75,BTN, GROUP,"Group Modes",
2,2,85,90,BTN, GROUP,"Another Grouping",
6,40,81,55,BTN, PUSH,"Complete Something",
6,60,81,75,BTN, PUSH,"Complete Another",
90,80,200,135, COMBO,DROPDOWN,
"Test data 1|Test data 2|Test data 3|Test data 4|Test data 5|Test data 6|Test data 7|",Res1$
90,100,200,112,EDIT,STRING,"Edit Control",Res2$,
90,116,200,170,LIST,SINGLE,"List test data|more test information|test list information|extra list info|yet more info|still more follows|",Res3$,
5, 95, 85, 175, STATIC, CENTER,"This is some centered text in a static control region e.g. for error messages or other instructions. The font used for all dialog item text is the same as all the built-in dialogs." )
If Res <> 0
DrawBackground
DrawNumber(10,40,Res)
DrawNumber(40,40,State1) DrawNumber(60,40,State2)
DrawNumber(40,60,State3) DrawNumber(60,60,State4)
DrawText(10,80,Res1$)
DrawText(10,100,Res2$)
DrawText(10,120,Res3$)
Endif
Msg$ = "Edit controls can be single or multi-line strings (like this one). Type in the control, with carriage returns. This type of control is handy to display and edit the contents of text files."
DrawBackground
DialogBox(0,0,210,160,"Edit Control Dialog Box for PiXCL 4.4", CAP_NCTR,
15,25, 48,48, ICON01,
30,145,80,158,"&Cancel", 2, Res,
130,145,180,158,BTN, PUSH,"&OK",
5,5,205,143,EDIT,MLSTRING,Msg$,Res2$)
Res2$ = "Returned Editted Text: " + Res2$
DrawTextExt(30,40,400,400,Res2$,LEFT)
WaitInput(2000)
DrawBackground
DrawShadowTextExt(30,40,400,400,
"When you use the image processing commands, it is often desirable to be able to select a set of 1, 2, 3 or more numeric values. The DialogBox command can be used to do this too. The position of the dialogs and default values are easily set by passing coordinates and defaults to the subroutines.",LEFT,255,255,255,1)
LoRange$ = "20"
Fdx1 = 220 Fdy1 = 70
FunctionDialogTitle$ = "Set Maximum Value"
InputValue$ = "100"
GoSub ShowFunctionDialog1 {returns FDRes}
LoRange$ = "20" HiRange$ = "220"
Fdx1 = 220 Fdy1 = 70
FunctionDialogTitle$ = "Set Normalize Range Values"
GoSub ShowFunctionDialog2 {returns FDRes}
HiRange$ = "220"
MidRange$ = "200"
LoRange$ = "180"
Fdx1 = 220 Fdy1 = 70
FunctionDialogTitle$ = "Set Gamma Values (x100)"
GoSub ShowFunctionDialog3 {returns FDRes}
DrawBackground
DrawShadowTextExt(30,40,400,400,
"HTML based controls are also supported. This requires that Internet Explorer 4.01 or 5 has been installed, with Active Desktop. If IE4 or IE5 is not installed, this command does nothing.", LEFT,255,255,255,1)
"You can click on a file and then the 'Open' button, or double click the file to open. What is returned to your program is the filename. You have to then do something with this filename. e.g. it is an image, pass it to a DrawBitmap command. You can also change the style of filename presentation with the buttons at the top of the dialog.",
"You can click on a file and then the 'Save' button, or double click the file to save. What is returned to your program is the filename. You have to then do something with this filename. e.g. it is an image, pass it to a SaveBitmap command.
You can also change the style of filename presentation with the buttons at the top of the dialog.",
"Use this common dialog when you want to give the user control over the font, style and color of text to be displayed in a PiXCL application client area, or in buttons and edit controls.",
"Pens, brushes, fonts and fill colors can be selected from the ChooseColor dialog. There are two dialog size styles, standard and full, that provide user color selection.
Additionally, the dialog position, title string, basic and custom strings can be specified.
The 16 custom colors can be set and reset with the CustomColor command. These colors remain in force until changed, or until the PiXCL application terminates. You could also store and recall these colors in the Registry or in an INI file.",
LEFT)
WaitInput(5000)
Red = 255 Green = 0 Blue = 255
ChooseColor(STD,Red,Green,Blue,200,300,"Standard colour selection","Available basic colors","Custom colours set to default")
If Red = -1 Then Goto Wait_for_Input
{Goto Wait_for_Input}
ChooseColorDlg:
Red = 255 Green = 0 Blue = 255
{Have to set these to default values}
CustomColor(255,0,0, 0,255,0, 0,0,255, 255,255,0,
0,255,0, 0,255,255, 192,192,192, 255,160,0,
160,255,0, 0,255,160, 0,0,255, 255,255,0,
0,255,0, 0,255,255, 255,255,255, 255,255,255)
ChooseColor(STD,Red,Green,Blue,200,300,"Standard colour selection","","Custom colours defined by command")